package entity

import (
	"github.com/jinzhu/gorm"
	"golang.org/x/net/context"
)

type Privilege struct {
	Model Model `gorm:"embedded"`
	//ID			int64				`gorm:"column:id;primary_key" json:"id"`
	Number      uint   `gorm:"number" json:"number"`
	Name        string `gorm:"name; unique; size:32" json:"name"`
	Text        string `gorm:"text"`
	Description string `gorm:"description"`
	//PrivilegeID	 	int64		`gorm:"privilege_id"`
	//RoleID int64 		// `gorm:"privilegeId"`
	//RoleID	 	int64	`gorm:"role_id"`
}

type Privileges []Privilege


// GetRoleDB 获取角色存储
func GetPrivilegeDB(ctx context.Context, defDB *gorm.DB) *gorm.DB {
	return GetDBWithModel(ctx, defDB, new(Role))
}
